<?php $album = Doctrine_Core::getTable('Album')->find($albumId)?>

<?php echo link_to('зургийн цомгууд', 'gallery/index', array('class'=>'title'))?> 
<span class="separator"> | </span>
<?php echo link_to('цомог нэмэх', 'gallery/new', array('class'=>'title'))?> 
<span class="separator"> | </span>
<?php echo link_to('"'.$album.'" зургууд', 'gallery/images?albumId='.$albumId, array('class'=>'title'))?> 
<span class="separator"> | </span>
<?php echo link_to('зураг оруулах', 'gallery/newImage?albumId='.$albumId, array('class'=>'title'))?>
<br clear="all">
<br clear="all">


<form action="<?php echo url_for('gallery/'.($form->getObject()->isNew() ? 'createImage' : 'updateImage').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>
          <input type="submit" value="Хадгалах" />
          &nbsp;<a href="<?php echo url_for('gallery/images?albumId='.$albumId) ?>">Жагсаалтруу буцах</a>
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['album_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['album_id']->renderError() ?>
          <?php echo $form['album_id'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['filename']->renderLabel() ?></th>
        <td>
          <?php echo $form['filename']->renderError() ?>
          <?php echo $form['filename'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['description']->renderLabel() ?></th>
        <td>
          <?php echo $form['description']->renderError() ?>
          <?php echo $form['description'] ?>
        </td>
      </tr>
      <tr>
        <td><?php echo $form['is_cover']->renderLabel() ?></td>
        <td>
          <?php echo $form['is_cover'] ?>
          <?php echo $form['is_cover']->renderHelp() ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>